function fuzzySearchObjects(query, items, keys) {
  return items.filter(item => {
    return keys.some(key => {
      const value = String(item[key]).toLowerCase();
      return value.includes(query.toLowerCase());
    });
  });
}

export default fuzzySearchObjects
// // 使用示例
// const results = fuzzySearchObjects('gal', products, ['name', 'category']);
// console.log(results); // [{ id: 2, name: 'Samsung Galaxy', category: 'phone' }]